<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> 
<%@ taglib uri="/struts-tags" prefix="s" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<base href="<%=basePath%>"> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>MainScrap</title>
    <%@include file="../header.html" %>
        
</head>
<%String side_bar_page = basePath+"side_bar.jsp"; %>
<body >

    <div >
		<jsp:include page="../side_bar.jsp" flush="true"/> 
		<jsp:include page="../top_bar.jsp" flush="true"/> 

        </div>
        
 <div style="margin:20px;"> 
     
    <form action="my_scrap_doQuery_success_scrapMain.action" method="post">  
        <table align="center">  
            <tr>  
                <td style="vertical-align: middle;">资产名称 
                    <input type="text" style="width: 200px;height: 30px;font-size: 16px" name="queryText"  value="${searchText }"/>  
                    <input type="submit" value="Query" style="width: 100px;height: 30px;font-size: 16px"/>      
                </td>  
            </tr>  
        </table>  
    </form>  
    
    <table id="t_scraplist" align="center" border="1" cellpadding="0" cellspacing="0" bordercolor="#3366cc" style="margin:10px;">  
        <tr align="center" bgcolor="#3399cc" height="26px">  
            <td width="80">报废编号</td>  
            <td width="100">资产名称</td>
            <td width="80">报废人</td>  
            <td width="120">报废日期</td>  
            <td width="80">审核人</td>  
            <td width="120">审核日期</td> 
            <td width="80">状态</td>   
            <td width="120">其他操作</td>  
        </tr>  
          
        <c:forEach var="scrap" items="${scraps }">  
            <tr align="center"  height="24px">  
                <td width="80">${scrap.scrapid}</td>  
                <td width="100">${scrap.assetid.assetname}</td>  
                <td width="80">${scrap.scraperid.username}</td>  
                <td width="120">${scrap.scraptime}</td>  
                <td width="80">${scrap.checkerid.username}</td>  
                <td width="120">${scrap.checktime}</td>  
              <!--  <td width="80">${scrap.state}</td> -->  
               <td width="80">
		                <c:if test="${scrap.state==0}">待审核</c:if> 
		                  <c:if test="${scrap.state==1}">已审核</c:if> 
                  </td>    
                <td width="120"> 
                	<a href="my_Asset_doDetail_success_detailScape.action?assetid=${scrap.assetid.assetid}">详细</a>
                	<c:if test="${scrap.state==0}"><a href="my_scrap_ChangeAndMark_success_scrapMain.action?scrapid=${scrap.scrapid}&assetid=${scrap.assetid.assetid}&userid=${session.userid}">报废审核</a></c:if> 
                </td> 
            </tr>  
        </c:forEach>  
    </table>  
	
 


      <!-- 分页 -->
  <center>
    <div > 
        共有 <span id="spanTotalInfor"></span> 条记录     
        当前第<span id="spanPageNum"></span>页     
        共<span id="spanTotalPage"></span>页
    </div>
    <div >   
            <span id="spanFirst" >FIRST</span> 
            <span id="spanPre">UP</span>
            <span id="spanInput" style="margin: 0px; padding: 0px 0px 4px 0px; height:100%; "> 
                第<input id="Text1" type="text" class="TextBox" onkeyup="changepage()"   style="height:20px; text-align: center;width:50px" />页 
            </span>
            <span id="spanNext">DOWN</span> 
            <span  id="spanLast">LAST</span> 
        </div>
</center>
    <script type="text/javascript">
            var theTable = document.getElementById("t_scraplist");
            var txtValue = document.getElementById("Text1").value;
            function changepage() {
                var txtValue2 = document.getElementById("Text1").value;
                if (txtValue != txtValue2) {
                    if (txtValue2 > pageCount()) {

                    }
                    else if (txtValue2 <= 0) {

                    }
                    else if (txtValue2 == 1) {
                        first();
                    }
                    else if (txtValue2 == pageCount()) {
                        last();
                    }
                    else {
                        hideTable();
                        page = txtValue2;
                        pageNum2.value = page;

                        currentRow = pageSize * page;
                        maxRow = currentRow - pageSize;
                        if (currentRow > numberRowsInTable) currentRow = numberRowsInTable;
                        for (var i = maxRow; i < currentRow; i++) {
                            theTable.rows[i].style.display = '';
                        }
                        if (maxRow == 0) { preText(); firstText(); }
                        showPage();
                        nextLink();
                        lastLink();
                        preLink();
                        firstLink();
                   }

                    txtValue = txtValue2;
                }
            }
            
    </script>
    <script type="text/javascript" src="./js/Pagging.js"></script>
			
    </div>
    
   <%@include file="../footer.html" %>
  </body> 
</html>  
